<%--
  Created by IntelliJ IDEA.
  User: 愿黑星照常升起
  Date: 2023/11/5
  Time: 11:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:useBean id="registerFormBean" class="cn.edu.xaut.bean.RegisterFormBean" scope="request"></jsp:useBean>
<html>
<head>
    <title>注册页面</title>
    <link rel="stylesheet" href="./static/plugins/bootstrap-3.4.1-dist/css/bootstrap.css">
    <style>
        .errorinfo {
            color: red;
            font-size: small;
        }
    </style>
</head>
<body>
<jsp:include page="header.jsp"/>
<!-- 页面主体 -->
<div id="account">
    <div style="text-align: center"><h2>新用户注册</h2></div>

    <form class="form-horizontal" method="post" action="registerServlet">
        <!-- 用户名组件 -->
        <div class="form-group">
            <label for="name" class="col-sm-2 control-label">用户名 <span style="color: red; font-size: larger;">*</span></label>
            <div class="col-sm-7">
                <input type="text" class="form-control" name="username" id="user" placeholder="请输入用户名">
                <label class="col-sm-3 errorinfo ">${formBean.errors.name}${DBMessage}</label>
            </div>
        </div>
        <!-- 密码组件 -->
        <div class="form-group">
            <label for="password" class="col-sm-2 control-label">密码<span style="color: red; font-size: larger;">*</span></label>
            <div class="col-sm-7">
                <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码">
                <label class="col-sm-3 errorinfo ">${formBean.errors.password}</label>
            </div>

        </div>
        <!-- 确认密码组件 -->
        <div class="form-group">
            <label for="password2" class="col-sm-2 control-label">确认密码<span
                    style="color: red; font-size: larger;">*</span></label>
            <div class="col-sm-7">
                <input type="password" class="form-control" id="password2" name="password2" placeholder="请输入密码"><label class="col-sm-3 errorinfo ">${formBean.errors.password2}</label>
            </div>
        </div>
        <!-- 邮箱组件 -->
        <div class="form-group">
            <label for="email" class="col-sm-2 control-label">邮箱<span
                    style="color: red; font-size: larger;">*</span></label>
            <div class="col-sm-7">
                <input type="email" class="form-control" id="email" name="email" placeholder="请输入邮箱"><label class="col-sm-3 errorinfo ">${formBean.errors.email}</label>
            </div>

        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-7">
                <button type="submit" class="btn btn-lg btn-primary btn-block">提交</button>
                <button type="reset" class="btn btn-lg btn-primary btn-block">重置</button>
            </div>
        </div>
    </form>
</div>

<script src="./static/js/jquery-3.6.0.min.js"></script>
<script src="./static/plugins/bootstrap-3.4.1-dist/js/bootstrap.js"></script>
<jsp:include page="footer.jsp"/>
</body>
</html>

